// import {port,} from "../create"
function fetchMock(response) {
  // console.log(response)
  fetch(`http://localhost:3333/createMock/${response.config.url}`, {
    body: JSON.stringify(response.data), // must match 'Content-Type' header
    cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
    credentials: "same-origin", // include, same-origin, *omit
    headers: {
      "user-agent": "Mozilla/4.0 MDN Example",
      "content-type": "application/json",
    },
    method: "POST", // *GET, POST, PUT, DELETE, etc.
    mode: "cors", // no-cors, cors, *same-origin
    redirect: "follow", // manual, *follow, error
    referrer: "no-referrer", // *client, no-referrer
  })
    .then((res) => res.json())
    .then((res) => console.log(res));
}

export default fetchMock;
